package com.thread.pool;

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestMainExecutorService {

	public static void main(String[] args) {

		ExecutorService exec = Executors.newCachedThreadPool();
		
		
		for (int i = 0; i < 1; i++) {
			exec.execute(new PrintRunnable("A" + i));
		}
		
		exec.shutdown();
		
		List<Runnable> shutdownedLists = exec.shutdownNow();
		
		if (shutdownedLists != null){
			System.err.println(shutdownedLists.size());
		}
		
		for (Runnable list : shutdownedLists) {
			System.out.println(((PrintRunnable)list).getContext());
		}
		
		
	}

}
